import request from '@/utils/request'

// 查询育儿知识库列表
export function listKnowledges(query) {
  return request({
    url: '/knowledges/knowledges/list',
    method: 'get',
    params: query
  })
}

// 查询育儿知识库详细
export function getKnowledges(knowledgeId) {
  return request({
    url: '/knowledges/knowledges/' + knowledgeId,
    method: 'get'
  })
}

// 新增育儿知识库
export function addKnowledges(data) {
  return request({
    url: '/knowledges/knowledges',
    method: 'post',
    data: data
  })
}

// 修改育儿知识库
export function updateKnowledges(data) {
  return request({
    url: '/knowledges/knowledges',
    method: 'put',
    data: data
  })
}

// 删除育儿知识库
export function delKnowledges(knowledgeId) {
  return request({
    url: '/knowledges/knowledges/' + knowledgeId,
    method: 'delete'
  })
}

// 查询育儿知识库列表
export function countKnowledges() {
  return request({
    url: '/knowledges/knowledges/count',
    method: 'get',
  })
}